package com.stylefeng.guns.rest.modular.jubao.service;

import com.baomidou.mybatisplus.mapper.Condition;
import com.stylefeng.guns.rest.common.persistence.dao.ContentMapper;
import com.stylefeng.guns.rest.common.persistence.dao.JubaoMapper;
import com.stylefeng.guns.rest.common.persistence.model.Content;
import com.stylefeng.guns.rest.common.persistence.model.Jubao;
import com.stylefeng.guns.rest.modular.content.controller.dto.CommentListRequest;
import com.stylefeng.guns.rest.modular.content.controller.dto.CommentListResponse;
import com.stylefeng.guns.rest.modular.jubao.controller.dto.JubaoRequest;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by ASUS-PC on 2018/6/26.
 */
@Service
public class JubaoService {
    @Autowired
    JubaoMapper jubaoMapper;


    public boolean intsert(JubaoRequest request){
        Jubao jubao = new Jubao();
        if(request.getUserId()>0){
            jubao.setUserId(request.getUserId());
        }
        jubao.setArtitleId(request.getArtitleId());
        jubao.setCreateTime(new Date());
        jubao.setJbType(request.getJbType());
        return jubaoMapper.insert(jubao)>0?true:false;

    }

}
